package top.songxs.gmall.feign.cart;

import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import top.songxs.gmall.cart.entity.CartItem;
import top.songxs.gmall.cart.vo.AddCartSuccessVo;
import top.songxs.gmall.common.result.Result;
import top.songxs.gmall.feign.cart.fallback.CartRpcFeignFallback;

import java.util.List;

@FeignClient(value = "service-cart",fallback = CartRpcFeignFallback.class)
public interface CartRpcFeignClient {


    @GetMapping(value = "api/inner/cart/addCart/{skuId}/{skuNum}")
    public Result<AddCartSuccessVo> addCart(@PathVariable(value = "skuId") Long skuId ,
                                            @PathVariable(value = "skuNum") Integer skuNum);



    @DeleteMapping(value = "api/inner/cart/deleteChecked")
    public Result deleteChecked() ;

    @GetMapping(value = "api/inner/cart/findAllCheckedCartItem")
    public Result<List<CartItem>> findAllCheckedCartItem() ;
}
